#include "GamePad.h"

#define  Pad_Padding_Left 10
#define  Pad_Padding_Buttom 10

bool GamePad::init()
{
    bool ret = false;
    do
    {
        CC_BREAK_IF(!CCLayer::init());

        this->setTouchEnabled(true);

        CCSprite * gamePadLeftSprite = CCSprite::create("gamepad-arrow.png",CCRect(0,22,32,42));
        CCSprite * gamePadUpSprite = CCSprite::create("gamepad-arrow.png",CCRect(22,0,42,32));
        CCSprite * gamePadRightSprite = CCSprite::create("gamepad-arrow.png",CCRect(54,22,32,42));
        CCSprite * gamePadDownSprite = CCSprite::create("gamepad-arrow.png",CCRect(22,54,42,32));


        this->addChild(gamePadLeftSprite);
        this->addChild(gamePadUpSprite);
        this->addChild(gamePadRightSprite);
        this->addChild(gamePadDownSprite);

        CCSize winSize = CCDirector::sharedDirector()->getWinSize();
        gamePadLeftSprite->setPosition(ccp(-winSize.width / 2 + 16 + Pad_Padding_Left, -winSize.height / 2 + 21 + 32 + Pad_Padding_Buttom ));
        gamePadUpSprite->setPosition(ccp(-winSize.width / 2  + 21 + 32 + Pad_Padding_Left, -winSize.height / 2 + 16 + 32 + 42 + Pad_Padding_Buttom ));
        gamePadRightSprite->setPosition(ccp(-winSize.width / 2  + 16 + 32 + 42 + Pad_Padding_Left, -winSize.height / 2 + 21 + 32 + Pad_Padding_Buttom ));
        gamePadDownSprite->setPosition(ccp(-winSize.width / 2  + 21 + 32 + Pad_Padding_Left, -winSize.height / 2 + 16 + Pad_Padding_Buttom));

        ret = true;
    } while (false);
    return ret;
}


void GamePad::ccTouchesEnded( CCSet* touches, CCEvent* event )
{

}

void GamePad::ccTouchesBegan( CCSet *pTouches, CCEvent *pEvent )
{

}

